package leaf.cloud.system.api.constants;

import lombok.Getter;

import java.util.HashMap;
import java.util.Map;

public enum WechatSecretEnum {
    MEMBER("Wechat:Member:", "0000001", ""),//通讯录
    INFORM("Wechat:Inform:", "1000037", "Tr6gp4BeeP04OxD6YiBvUPuh5CQAP_pccfaHamM2CR8"),//工作通知
    BI("Wechat:Bi:", "1000039", "vo04RD35jFpNsIoyfNgiIeC2oc2atUljRPqGi4RrGsg"),//零售BI
    UTILS("Wechat:Utils:", "1000042", "eT_HdPQJIpILOiUjuBE2YvXt3b06MFYtzfy-Zj-8PWQ"),//店铺工具包
    OMNICHANNEL("Wechat:Omnichannel:", "1000064", "nu0mTKl0NI2iR1XK9mU1lu5yPINpdVPbOilX6TVfPAw");//全渠道订单提醒

    @Getter
    private final String name;
    @Getter
    private final String key;
    @Getter
    private final String secret;

    WechatSecretEnum(String name, String key, String secret) {
        this.name = name;
        this.key = key;
        this.secret = secret;
    }

    private static final Map<String, WechatSecretEnum> KEY_MAP = new HashMap<>();

    static {
        for (WechatSecretEnum value : WechatSecretEnum.values()) {
            KEY_MAP.put(value.getKey(), value);
        }
    }

    public static WechatSecretEnum getByKey(String key) {
        return KEY_MAP.get(key);
    }
}
